﻿namespace SenGe.Domain
{
    /// <summary>
    /// 基础数据模型
    /// </summary>
    public class BaseLongIdEntity
    {
        /// <summary>
        /// 数据编号
        /// </summary>
        public long Id { get; set; }
    }

    /// <summary>
    /// 基础数据信息模型
    /// </summary>
    public class BaseInfoEntity : BaseLongIdEntity
    {
        /// <summary>
        /// 数据状态(1启用0未启用)
        /// 可扩展
        /// </summary>
        public int Status { get; set; } = 1;
        /// <summary>
        /// 数据删除标志
        /// </summary>
        public bool IsDeleted { get; set; } = false;
        /// <summary>
        /// 数据创建用户的编号
        /// </summary>
        public long CreatedUserId { get; set; }
        /// <summary>
        /// 数据创建用户的昵称
        /// </summary>
        public string? CreatedUserName { get; set; }
        /// <summary>
        /// 数据创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }
        /// <summary>
        /// 数据更新用户的编号
        /// </summary>
        public long UpdatedUserId { get; set; }
        /// <summary>
        /// 数据更新用户的昵称
        /// </summary>
        public string? UpdatedUserName { get; set; }
        /// <summary>
        /// 数据更新时间
        /// </summary>
        public DateTime UpdatedTime { get; set; }
    }


    /// <summary>
    /// 分页数据模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PagedList<T> where T : class
    {
        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 页大小
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 数据总条数
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 当前页数据列表
        /// </summary>
        public IEnumerable<T>? List { get; set; }
    }

    /// <summary>
    /// 基础编号名称模型
    /// </summary>
    public class BaseIntIdNameModel
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public required string Name { get; set; }
    }

    /// <summary>
    /// 接口返回模型
    /// </summary>
    public class ApiResult
    {
        /// <summary>
        /// 成功标志
        /// </summary>
        public bool Success { get; set; }
        /// <summary>
        /// 返回消息
        /// </summary>
        public string? Message { get; set; }
        /// <summary>
        /// 返回数据
        /// </summary>
        public dynamic? Data { get; set; }
    }
}
